/**
 * 
 */
package com.smarthome.rpc.sms;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

import com.smarthome.common.exception.ExceptionUtils;

/**
 * @author dhc
 * @date 2015年10月15日 下午12:02:04
 * @title
 */
public class Test {

	public static void main(String[] args) {
		ExceptionUtils.throwSms( "new message !",null);
		try {
			URL url = new URL("http://my.oschina.net/zh119893/blog/274003/");
			URLConnection connection = url.openConnection();
			//OutputStream out = connection.getOutputStream();
			
			InputStream inputStream = connection.getInputStream();
			BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
			
			while (in.ready()) {
				System.out.println(in.readLine());
				
			}
			
			System.out.println(url.getContent());
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
}
